package Satellites;

import java.io.File;
import java.util.ArrayList;

public class Constellation {

	private String constellationName;
	private String constellationURL;
	private ArrayList<Satellite> satelliteList;

	public Constellation(String constellationName, String constellationURL){
		this.constellationURL=constellationURL;
		this.constellationName=constellationName;
		satelliteList = new ArrayList<Satellite>();
	}

	public String getconstellationName() {
		return constellationName;
	}

	public String getConstellationURL() {
		return constellationURL;
	}

	public ArrayList<Satellite> getSatelliteList() {
		return satelliteList;
	}

	public void addSatelliteToList(String satelliteName, String satellitePath){
		File directory = new File(satellitePath);
		Satellite satellite = new Satellite(satelliteName, directory);
		satellite.addOrbit();
		satelliteList.add(satellite);
	}

	public String[] getVisibleSatellitesNameList() {
		int counter=0;
		for (int i =0; i !=satelliteList.size();i++){
			if (satelliteList.get(i).getIsVisible())
				counter++;
		}
		String []aux = new String[counter];
		for (int i =0; i !=satelliteList.size();i++){
			aux[i]= satelliteList.get(i).getSatelliteName();
		}
		return aux;
	}
	

	@Override
	public String toString(){
		return "Type Name: "+getconstellationName()+"---- URL: "+getConstellationURL();
	}




}
